<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>SVG Loader</title>
    <script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/ecom/esl/1-8-2/esl.js"></script>
</head>
<body>
    <script type="text/javascript">
    require.config({
        packages: [
            {
                name: 'zrender',
                location: '../../../src',
                main: 'zrender'
            },
            {
                name: 'svg',
                location: '../src',
                main: 'svg'
            }
        ]
    });

    require([
        "zrender",
        "svg"
    ], function(zrender, svg){

        // 初始化zrender
        var zr = zrender.init(document.getElementById("main"));

        svg.load('asset/tiger.svg', function(group) {
            zr.addGroup(group);
            group.onclick = function(e) {
                document.getElementById('log').innerHTML += '选中' + e.target.parent.id + ' > ' + e.target.type + ' <br />';
            };
            zr.render();
        }, {
            clickable: true,
            hoverable: false,
            namespace: 'tiger'
        });
    })
    </script>
    <div id="main" style="width:1000px;height:800px;"></div>
    <div id="log" style="position: fixed; right: 100px; top: 10px; line-height:30px;"></div>
</body>
</html>